package com.taomu.app.zongchouhuli.http.api;


import com.taomu.app.zongchouhuli.utils.StorageHelper;

import io.reactivex.functions.Function;
import okhttp3.ResponseBody;

public class BaseRequest {

    public ApiService getService() {
        return NetWork.getApi();
    }

    public String getToken() {
        // TODO: 2018/9/22 获取token
        return StorageHelper.getToken();
    }

    public String getUid(){
        return StorageHelper.getUid();
    }

    public Function<ResponseBody, String> getRespBodyMap() {
        return new Function<ResponseBody, String>() {

            @Override
            public String apply(ResponseBody responseBody) throws Exception {
                return responseBody.string();
            }
        };
    }
}
